package com.abc.base.controller;

import com.abc.base.common.response.Result;
import com.abc.base.dto.HouseQuery;
import com.abc.base.model.HouseInfoNew;
import com.abc.base.service.HouseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/house")
public class HouseController {
    @Autowired
    private HouseService houseService;

    @GetMapping("/page")
    public Result<Page<HouseInfoNew>> page(Integer pageNo, Integer pageSize, HouseQuery query) {
        Page<HouseInfoNew> page = new Page<>(pageNo, pageSize);
        return Result.success(houseService.page(page, query));
    }
}
